﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using FODATAC.Interfaces;
using FODATAC.Test.NorthWind;
using System.Linq;

namespace FODATAC.Test
{
	[TestClass]
	public class UnitTest2
	{
		[TestMethod]
		public void RealOData()
		{
			var uri = new Uri("http://services.odata.org/V3/(S(yspp3itmmyfhdm4nlavnz45s))/OData/OData.svc/");


			ISessionFactory sf = new SessionFactory(uri, "", "");
			var session = sf.OpenSession();

			var prod = session.Query<Product>().Where(k => k.ID == 0).Select(k => k.Supplier).FirstOrDefaultAsync().Result;
			
			session.FlushAsync().Wait();
		}
	}
}